# coding:utf-8
"""
@author: jing
@contact: 529548204@qq.com
@file: permissions.py
@time: 2022/6/1 15:07
"""
from rest_framework.permissions import BasePermission


class RegisterPermission(BasePermission):
    def has_permission(self, request, view):
        if view.action == "user_register":
            return True
        else:
            return bool(request.user and request.user.is_authenticated)
